package org.ranshiyan.pojo;

import org.springframework.data.annotation.CreatedDate;

import java.text.SimpleDateFormat;
import java.util.Date;

public class Orderx {

    private Integer id;
    private String name;
    private String username;
    private Integer orderType;
    private Date updateTime;
    @CreatedDate
    private Date creditTime;

    public Integer getId() {
        return id;
    }

    public Orderx setId(Integer id) {
        this.id = id;
        return this;
    }

    public String getName() {
        return name;
    }

    public Orderx setName(String name) {
        this.name = name;
        return this;
    }

    public String getUsername() {
        return username;
    }

    public Orderx setUsername(String username) {
        this.username = username;
        return this;
    }

    public Integer getOrderType() {
        return orderType;
    }

    public Orderx setOrderType(Integer orderType) {
        this.orderType = orderType;
        return this;
    }

    public Date getUpdateTime() {
        return updateTime;
    }

    public Orderx setUpdateTime(Date updateTime) {
        this.updateTime = updateTime;
        return this;
    }

    public Date getCreditTime() {
        return creditTime;
    }

    public Orderx setCreditTime(Date creditTime) {
        this.creditTime = creditTime;
        return this;
    }

    @Override
    public String toString() {
        return "Order{" +
                "id=" + id +
                ", name='" + name + '\'' +
                ", username='" + username + '\'' +
                ", orderType=" + orderType +
                ", updateTime='" + new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(updateTime) + '\'' +
                ", creditTime='" + new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(creditTime) + '\'' +
                '}';
    }
}
